package com.mapper;

import com.model.Order;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface OrderMapper {

    @Insert("insert into order(userid,groupid,price,status) values(#{userid},#{groupid},#{price},#{status})")
    public boolean insertOrder(@Param("userid")Long UserId,@Param("userid")Long GroupId,@Param("userid")Integer Price,@Param("userid")Boolean Status);

    @Select("select max(id) from order")
    public Long getCurrentIndex();

    @Select("select * from order where id=#{id}")
    public Order getOrderByOrderId(@Param("id")Long OrderId);
}
